package com.highcom.controller;

import com.highcom.domain.Student;
import com.highcom.service.StudentService;
import com.highcom.service.impl.StudentServiceImpl;
import org.junit.Test;

import java.util.List;

public class StudentController {

    private StudentService service = new StudentServiceImpl();

    @Test
    public void SelectAll(){
        List<Student> allStudent = service.findAllStudent();
        allStudent.forEach(System.out :: println);
    }
    @Test
    public void SelectById(){
        Student student=service.findStudentById(2);
        System.out.println(student);
    }
    @Test
    public void insert(){
        Student student = new Student();
        student.setName("dali");
        student.setAge(10);
        service.addStudent(student);

    }

    @Test
    public void updateStudnet(){
        Student student = new Student();
        student.setId(5);
        student.setName("dali01");
        student.setAge(11);
        service.updateStudent(student);

    }
    @Test
    public void delete(){
        service.deleteStudent(5);
    }



}
